queue on exit, even after a wakeup.
Otherwise, when we go round the loop in wait_event(), we may not
actually sleep after the first iteration, as we do not put ourselves
back on the queue on wakeup.
Signed-off-by: Keir Fraser <keir@xen.org>
{
char *cpu_info = (char *)get_cpu_info();
+ ASSERT(wqv->esp == 0);
+
asm volatile (
#ifdef CONFIG_X86_64
"push %%rax; push %%rbx; push %%rcx; push %%rdx; push %%rdi; "
struct waitqueue_vcpu *wqv = curr->waitqueue_vcpu;
ASSERT(!in_atomic());
- ASSERT(list_empty(&wqv->list));
+ __prepare_to_wait(wqv);
+ ASSERT(list_empty(&wqv->list));
spin_lock(&wq->lock);
list_add_tail(&wqv->list, &wq->list);
vcpu_pause_nosync(curr);
spin_unlock(&wq->lock);
-
- __prepare_to_wait(wqv);
}
void finish_wait(struct waitqueue_head *wq)